import React,{useState} from 'react'
import { Navigate } from 'react-router-dom'
export default function Index() {
  const [count,setCount] = useState(0)
  return (
    <>
      <h1>这里是首页</h1>
      {count==2?<Navigate to="/list" />:<h4>求和的值为:{count}</h4>}
      <button onClick={() => setCount(2)}>+1</button>
    </>
  )
}
